local ads__fancheng = fk.CreateSkill{
  name = "ads__fancheng",
  tags = { Skill.Compulsory },
}

ads__fancheng:addEffect("prohibit", {
  is_prohibited = function(self, from, to, card)
    if to:hasSkill(ads__fancheng.name) and not to:isKongcheng() and card and from ~= to then
      return not table.contains({"slash", "duel"}, card.trueName)
    end
  end,
})

ads__fancheng:addEffect(fk.AfterCardsMove, {
  can_refresh = function(self, event, target, player, data)
    if not (player:hasSkill(ads__fancheng.name) and not player:isKongcheng()) then return end
    for _, move in ipairs(data) do
      if move.from == player then
        for _, info in ipairs(move.moveInfo) do
          if info.fromArea == Card.PlayerHand then
            return true
          end
        end
      end
    end
  end,
  on_refresh = function(self, event, target, player, data)
    player:broadcastSkillInvoke(ads__fancheng.name)
    player.room:notifySkillInvoked(player, ads__fancheng.name, "defensive")
  end,
})

Fk:loadTranslationTable{
  ["$ads__fancheng1"] = "（悠扬的琴音）",
  ["$ads__fancheng2"] = "（低沉的琴音）",
  ["ads__fancheng"] = "繁城",
  [":ads__fancheng"] = "锁定技，若你有手牌，其他角色不能选择你为非【杀】或【决斗】牌的目标。",
}

return ads__fancheng
